package top.pmwly;

/**
 * @author Herther
 * @version 1.0.0
 * @ClassName Test2.java
 * @Description 测试性能
 * @createTime 2021年08月15日 18:48:00
 */
public class Test2 {

    public static void main(String[] args) {
        int n = 10000;
        Integer[] data =  ArrayGenerate.randomGenerate(n,n);
        long startTime = System.nanoTime();
        SelectionSortT.sort(data);
        long entTime = System.nanoTime();
        double time = (entTime - startTime) / 1000000000.0;
        //检查是否排序正确
        boolean sorted = SortHelper.sorted(data);
        if (!sorted){
            throw new RuntimeException("排序有误");
        }
        System.out.println("排序"+n+"个数所用时间："+time);
    }
}
